<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>三角形</title>
    <link rel="stylesheet" href="./css/reset.css" />
    <style>
      .arrow {
        width: 80px;
        height: 80px;
        border: 1px solid #ddd;
        padding: 40px;
        margin: 30px;
      }

      .arrow::after {
        content: "";
        /*width:16px;*/
        box-sizing: border-box;
        height: inherit;
        display: block;
        /* background-color: khaki; */
        border-top: 1px solid #ddd;
        border-left: 1px solid #ddd;
        transition: transform 1s;
      }

      .arrow-up::after {
        /* 先位移，后旋转，不会发生位移，位移长度是盒子对角线的1/4 */
        /* transform: translateY(5.6px) rotate(45deg); */
        /* transform: translateY(35%) rotate(45deg); */
        /* 视觉上居中 */
        transform: translateY(25%) rotate(45deg);
      }

      .arrow-down::after {
        transform: translateY(-25%) rotate(-135deg);
      }

      .arrow-up:hover::after {
        transform: translateY(-25%) rotate(-135deg);
      }

      .arrow-down:hover::after {
        transform: translateY(25%) rotate(45deg);
      }
    </style>
  </head>
  <body>
    <!-- <div class="arrow"></div> -->
    <div class="arrow arrow-up"></div>
    <div class="arrow arrow-down"></div>
  </body>
</html>
